/*
 * $Id: ctype.h,v 1.14 2005-07-01 05:07:24 bacon Exp $
 */

#ifndef _XP_BAS_CTYPE_H_
#define _XP_BAS_CTYPE_H_

#include <xp/types.h>
#include <xp/macros.h>

#define XP_CHAR_TRAIT_UPPER  (1 << 0)
#define XP_CHAR_TRAIT_LOWER  (1 << 1)
#define XP_CHAR_TRAIT_ALPHA  (1 << 2)
#define XP_CHAR_TRAIT_DIGIT  (1 << 3)
#define XP_CHAR_TRAIT_XDIGIT (1 << 4)
#define XP_CHAR_TRAIT_ALNUM  (1 << 5)
#define XP_CHAR_TRAIT_SPACE  (1 << 6)
#define XP_CHAR_TRAIT_PRINT  (1 << 8)
#define XP_CHAR_TRAIT_GRAPH  (1 << 9)
#define XP_CHAR_TRAIT_CNTRL  (1 << 10)
#define XP_CHAR_TRAIT_PUNCT  (1 << 11)
/*
#define XP_CHAR_TRAIT_ASCII  (1 << 12)
#define XP_CHAR_TRAIT_IDEOG  (1 << 13)
#define XP_CHAR_TRAIT_PHONO  (1 << 14)
#define XP_CHAR_TRAIT_ENGLI  (1 << 15)
*/

/* TODO: need to rewrite. */
/*
#if defined(XP_CHAR_IS_MCHAR)
	#include <ctype.h>
	#define xp_isalnum(c)     isalnum(c)
	#define xp_isalpha(c)     isalpha(c)
	#define xp_iscntrl(c)     iscntrl(c)
	#define xp_isdigit(c)     isdigit(c)
	#define xp_isgraph(c)     isgraph(c)
	#define xp_islower(c)     islower(c)
	#define xp_isprint(c)     isprint(c)
	#define xp_ispunct(c)     ispunct(c)
	#define xp_isspace(c)     isspace(c)
	#define xp_isupper(c)     isupper(c)
	#define xp_isxdigit(c)    isxdigit(c)
	#define xp_tolower(c)     tolower(c)
	#define xp_toupper(c)     toupper(c)
#endif
*/
	
#ifdef __cplusplus
extern "C" {
#endif

extern xp_bool_t (*xp_isupper)  (xp_cint_t c);
extern xp_bool_t (*xp_islower)  (xp_cint_t c);
extern xp_bool_t (*xp_isalpha)  (xp_cint_t c);
extern xp_bool_t (*xp_isdigit)  (xp_cint_t c);
extern xp_bool_t (*xp_isxdigit) (xp_cint_t c);
extern xp_bool_t (*xp_isalnum)  (xp_cint_t c);
extern xp_bool_t (*xp_isspace)  (xp_cint_t c);
extern xp_bool_t (*xp_isprint)  (xp_cint_t c);
extern xp_bool_t (*xp_isgraph)  (xp_cint_t c);
extern xp_bool_t (*xp_iscntrl)  (xp_cint_t c);
extern xp_bool_t (*xp_ispunct)  (xp_cint_t c);
extern xp_cint_t (*xp_toupper)  (xp_cint_t c);
extern xp_cint_t (*xp_tolower)  (xp_cint_t c);

extern xp_bool_t (*xp_misupper)  (xp_mcint_t c);
extern xp_bool_t (*xp_mislower)  (xp_mcint_t c);
extern xp_bool_t (*xp_misalpha)  (xp_mcint_t c);
extern xp_bool_t (*xp_misdigit)  (xp_mcint_t c);
extern xp_bool_t (*xp_misxdigit) (xp_mcint_t c);
extern xp_bool_t (*xp_misalnum)  (xp_mcint_t c);
extern xp_bool_t (*xp_misspace)  (xp_mcint_t c);
extern xp_bool_t (*xp_misprint)  (xp_mcint_t c);
extern xp_bool_t (*xp_misgraph)  (xp_mcint_t c);
extern xp_bool_t (*xp_miscntrl)  (xp_mcint_t c);
extern xp_bool_t (*xp_mispunct)  (xp_mcint_t c);
extern xp_mcint_t (*xp_mtoupper)  (xp_mcint_t c);
extern xp_mcint_t (*xp_mtolower)  (xp_mcint_t c);

extern xp_bool_t (*xp_wisupper)  (xp_wcint_t c);
extern xp_bool_t (*xp_wislower)  (xp_wcint_t c);
extern xp_bool_t (*xp_wisalpha)  (xp_wcint_t c);
extern xp_bool_t (*xp_wisdigit)  (xp_wcint_t c);
extern xp_bool_t (*xp_wisxdigit) (xp_wcint_t c);
extern xp_bool_t (*xp_wisalnum)  (xp_wcint_t c);
extern xp_bool_t (*xp_wisspace)  (xp_wcint_t c);
extern xp_bool_t (*xp_wisprint)  (xp_wcint_t c);
extern xp_bool_t (*xp_wisgraph)  (xp_wcint_t c);
extern xp_bool_t (*xp_wiscntrl)  (xp_wcint_t c);
extern xp_bool_t (*xp_wispunct)  (xp_wcint_t c);
extern xp_wcint_t (*xp_wtoupper)  (xp_wcint_t c);
extern xp_wcint_t (*xp_wtolower)  (xp_wcint_t c);

#ifdef __cplusplus
}
#endif

#endif
